// 引入上一任前段封装的axios
import axios from '../../network/axios'

/* 

  这个是直营店中 ————> 基础信息表中的所有接口

*/

/* 
   1. vip建档页面的接口
 */

// 一进入页面的时候，马上获取所有vip数据的接口(直营店编号必须传)
export const get_vip_dataApi = (params) => {
  return axios({
    method: 'GET',
    url: '/vip-customer/list',
    params
  })
}

// 点击查询，获取后端数据的api
export const queryAllVipDataApi = (params) => {
  return axios({
    method: 'GET',
    url: '/vip-customer/list',
    params
  })
}

// // 点击新建资料的时候，获取营业员（操作员）数据
// export const get_trade_assistant_dataApi = () => {
//   return axios({
//     method: 'GET',
//     url: '/customerTransferCargoTotal/getOperatorList'
//   })
// }
export const get_trade_assistant_dataApi = (params) => {
  return axios({
    method: 'GET',
    url: '/vip-personnel/list',
    params
  })
}

// 点击继续录入的时候，发起ajax请求，开始新建资料（新增VIP客户）
export const add_vip_customer_dataApi = (data) => {
  return axios({
    method: 'POST',
    url: '/vip-customer/insert',
    data
  })
}

// 在编辑状态下，点击保存的时候，要发起的APi
export const editStatus_clickKeep_dataApi = (data) => {
  return axios({
    method: 'PUT',
    url: '/vip-customer/update',
    data
  })
}

// 点击删除的时候，直接删除这一表格行的数据
export const delete_current_rowDataApi = (id) => {
  return axios({
    method: 'DELETE',
    url: '/vip-customer/delete',
    params: {
      id
    }
  })
}
// 获取卡别的接口
export const get_cardType_data_api = () => {
  return axios({
    method: 'GET',
    url: '/vip-card-type/list'
  })
}
/* 
  充值模块接口
*/

// 查询充值记录接口
export const query_vip_pay_notes_api = (params) => {
  return axios({
    method: 'GET',
    url: '/vip-recharge/list',
    params
  })
}

// 充值的接口
export const pay_api = (data) => {
  return axios({
    method: 'POST',
    url: '/vip-recharge/inset',
    data
  })
}

// 删除充值记录的接口
export const delete_pay_notes_api = (params) => {
  return axios({
    method: 'DELETE',
    url: '/vip-recharge/deleteRecharge',
    params
  })
}

/* 
   营业员建档模块
*/

// 新建VIP职员api， 点击保存相当于新建
export const new_build_vip_personnel = (data) => {
  return axios({
    method: 'POST',
    url: '/vip-personnel/insert',
    data
  })
}

// 查询VIP职员（营业员） 点击查询按钮的时候
export const query_vip_personnel = (params) => {
  return axios({
    method: 'GET',
    url: '/vip-personnel/list',
    params
  })
}

// 点击删除按钮的时候，触发的函数 删除VIP职员
export const delete_vip_personnel_api = (id) => {
  return axios({
    method: 'DELETE',
    url: '/vip-personnel/delete',
    params: {
      id
    }
  })
}

/* 
    业绩目标模块
*/

// 新增业绩目标，点击保存的时候，新增
export const add_achievement_target_api = (data) => {
  return axios({
    method: 'POST',
    url: '/vip-personnel-target/insert',
    data
  })
}
// 业绩目标查询 点击查询按钮的时候，触发
export const query_achievement_target_api = (params) => {
  return axios({
    method: 'GET',
    url: '/vip-personnel-target/list',
    params
  })
}
// 修改开卡目标/销售目标

export const change_open_card_or_sales_target_api = (data) => {
  return axios({
    method: 'PUT',
    url: '/vip-personnel-target/update',
    data
  })
}

// 删除职员目标业绩，点击删除的时候，触发的api
export const delete_achievement_target_api = (id) => {
  return axios({
    method: 'DELETE',
    url: '/vip-personnel-target/delete',
    params: {
      id
    }
  })
}

/* 
    收款方式模块
*/

// 添加收款方式的api

export const add_payment_api = (data) => {
  return axios({
    method: 'POST',
    url: '/vip-payment/insert',
    data
  })
}
// 查询付款方式
export const query_payment_api = () => {
  return axios({
    method: 'GET',
    url: '/vip-payment/list'
  })
}
// 删除付款方式
export const delete_payment_api = (params) => {
  return axios({
    method: 'DELETE',
    url: '/vip-payment/delete',
    params
  })
}

/* 
  参数设定模块 （vip店铺全局设置控制层）
*/
//
export const query_params_setting_api = () => {
  return axios({
    method: 'GET',
    url: '/vip-system-config/list'
  })
}

// 新增/修改

export const add_params_setting_api = (data) => {
  return axios({
    method: 'POST',
    url: '/vip-system-config/insertOrUpdate',
    data
  })
}

// 修改会员密码
export const modify_password_api = (params) => {
  return axios({
    method: 'GET',
    url: '/vip-customer/updatePass',
    params
  })
}
// 获取验证码

export const get_code_api = (params) => {
  return axios({
    method: 'GET',
    url: '/login/smsPhone',
    params
  })
}

// VIP客户忘记密码

export const forget_password_api = (params) => {
  return axios({
    method: 'GET',
    url: '/vip-customer/forgotPassword',
    params
  })
}
